package com.源码分析;

import org.junit.Test;

import reactor.core.publisher.Flux;
import reactor.core.scheduler.Schedulers;

public class FluxPublishOn {

	@Test
	public void test() {
		Flux.just("A", "B")
		.map(x -> {
			return x + "-ok";
		})
		.publishOn(Schedulers.newElastic("publishOn"))
		.subscribe(x -> {
			System.out.println("subscribe: " + Thread.currentThread().getName());
			System.out.println(x);
		});
		try {
			Thread.sleep(1000000000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
	}

}
